package logreport

// LogType 日志类型
type LogType string

func (l LogType) String() string {
	return string(l)
}

const (
	SystemEnvironment  LogType = "SYSTEM_ENVIRONMENT"  //系统环境: CPU 内存 硬盘 网络 版本信息等
	ServiceEnvironment LogType = "SERVICE_ENVIRONMENT" //服务内环境: 协程池 线程池 缓存缓冲
	Runtime            LogType = "RUNTIME"             //服务运行情况: 耗时 开始时间
	Service            LogType = "SERVICE"             //业务
	Transaction        LogType = "TRANSACTION"         //事务时效
	Interface          LogType = "INTERFACE"           //接口调用
)

// TransType 事件类型
type TransType int

const (
	RealPlay      TransType = iota + 1 //实时调阅
	Playback                           //历史调阅
	Panoramic                          //全景调阅
	Subscribe                          //订阅通知
	DeviceControl                      //设备控制
	DeviceQuery                        //设备查询
	Router                             //路由控制
	ServiceInit                        //服务初始化
	Configure                          //配置管理
	HeartBeat                          //心跳状态
	Authorization                      //鉴权
	LogAnalysis                        //日志分析
)

// ActionType 操作行为
type ActionType int

const (
	Start             ActionType = iota + 21 //开始调阅
	Stop                                     //结束调阅
	Sub                                      //订阅
	UnSub                                    //退订
	Notify                                   //通知
	PTZ                                      //云台控制
	Focal                                    //焦距控制
	DeviceInfo                               //信息查询
	DeviceStatus                             //状态查询
	DeviceList                               //目录查询
	DeviceHeartbeat                          //设备心跳状态
	SipRouter                                //信令路由
	MediaRouter                              //媒体路由
	ServiceStart                             //服务启动
	ServiceConfig                            //获取配置
	ServiceConnect                           //服务连接
	ServiceDisconnect                        //断线
	ServiceRetry                             //重连
	DeviceAdd                                //设备新接入
	DeviceActive                             //设备启用
	DeviceInactive                           //设备停用
	DeviceDelete                             //设备删除
	ServiceAdd                               //服务新增
	ServiceEdit                              //服务变更
	ServiceOnline                            //服务上线
	ServiceOffline                           //服务下线
	ServiceHeartbeat                         //服务心跳状态
	AppRegister                              //app注册
	AppReset                                 //app重置
	AppQuery                                 //app查询
	AppDelete                                //app删除
	GetToken                                 //获取token
	TokenRefresh                             //更新token
	TokenTimeout                             //token超时
	LogStatistic                             //日志统计
)

// CodeType 错误码
type CodeType int

const (
	StatusOK           CodeType = 200
	StatusBadRequest   CodeType = 400
	StatusUnauthorized CodeType = 401
	StatusForbidden    CodeType = 403
	StatusNotFound     CodeType = 404
	ErrorUnknown       CodeType = 99999
)

//10000-19999 调阅中心
const (
	ErrorOpenApiInitFailed CodeType = iota + 10000
)

//20000-29999 设备管理中心
const (
	ErrorDeviceManagerInitFailed CodeType = iota + 20000
)

//30000-39999 鉴权中心
const (
	ErrorAuthorizationInitFailed CodeType = iota + 30000
)

//40000-49999 级联中心
const (
	ErrorSipServerInitFailed CodeType = iota + 40000
)

//50000-59999 非国标接入中心
const (
	ErrorConnectCenterInitFailed CodeType = iota + 50000
)

//60000-69999 媒体中心
const (
	ErrorMediaServerInitFailed CodeType = iota + 60000
)

//70000-79999 日志管理中心
const (
	ErrorLogManagerInitFailed CodeType = iota + 70000
)

//80000-89999 客户端
const (
	ErrorClientInitFailed CodeType = iota + 80000
)

//90000-99998 运维端
const (
	ErrorOMSInitFailed CodeType = iota + 90000
)
